﻿using JTTD.Domain.Dtos;
using JTTD.Domain.Dtos.Integral;
using Microsoft.AspNetCore.Http;
using JTTD.Domain.Dtos.Integral.Response;
using System.Collections.Generic;
using System.Threading.Tasks;
using JTTD.Common.Enum;
using JTTD.Domain.Dtos.Integral.Reuqest;
using JTTD.Domain.Dtos.Integral.Request;

namespace JTTD.Domain.IService
{
    /// <summary>
    /// 积分服务
    /// </summary>
    public interface IIntegralService : IDependency
    {
        /// <summary>
        /// 分页获取用户积分收支记录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult<PageResult<IntrgralRecordResponseDto>>> GetRecordPageList(SearchIntrgralRecordRequestDto dto);

        /// <summary>
        /// 提交账单核算积分申请
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="fileUrl"></param>
        /// <param name="amount"></param>
        /// <param name="phone"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> CrateApply(int userId, string fileUrl, decimal amount,string phone);

        /// <summary>
        /// 审核账单核算积分申请
        /// </summary>
        /// <param name="applyId"></param>
        /// <param name="applyState"></param>
        /// <param name="reason"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> ExamineApply(int applyId, ApplyStateEnum applyState, string reason = null);

        /// <summary>
        /// 分页获取账单核算积分申请
        /// </summary>
        /// <returns></returns>
        Task<ApiResult<PageResult<IntegralApplyResponseDto>>> GetApplyList(SearchIntegralApplyRequestDto request, int? userId);

        /// <summary>
        /// 赠送指定用户积分
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> GiveIntegral(int userId, decimal amount);

        /// <summary>
        /// 赠送指定用户积分
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> RemoveIntegral(int userId, decimal amount);

        /// <summary>
        /// 获取用户积分
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<decimal> GetUserIntegral(int userId);

        Task<ApiResult<PageResult<IntrgralReportResponseDto>>> PageIntrgralReport(SearchIntrgralReportRequestDto dto);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<IntrgralReportExportResponseDto>> GetIntrgralReportExportList(SearchIntrgralReportRequestDto dto);

        Task<ApiResult<bool>> Fix();
    }
}